<div class="inmodal">
    <div class="modal-header">
        <h4 class="modal-title">{{operation | translate}}(ID:{{shopfloor.id}})</h4>
    </div>
    <div class="modal-body">
        <form role="form" name="form_shopfloor" novalidate class="form-horizontal">
            <div class="form-group"><label class="col-sm-2 control-label">{{'SETTING.NAME' | translate}}</label>
              <div class="col-sm-10">
                  <input ng-model="shopfloor.name" type="text" name="shopfloorname" class="form-control" required>
                  <div class="m-t-xs" ng-show="form_shopfloor.shopfloorname.$invalid && form_shopfloor.shopfloorname.$dirty">
                      <small class="text-danger" ng-show="form_shopfloor.shopfloorname.$error.required">{{'SETTING.INPUT_NAME' | translate}}</small>
                  </div>
              </div>
            </div>
            <div class="form-group"><label class="col-sm-2 control-label">{{'SHOPFLOOR.AREA' | translate}}</label>
                <div class="col-sm-10">
                    <input ng-model="shopfloor.area" type="number" name="shopfloorarea" class="form-control" required>
                    <div class="m-t-xs" ng-show="form_shopfloor.shopfloorarea.$invalid && form_shopfloor.shopfloorarea.$dirty">
                        <small class="text-danger" ng-show="form_shopfloor.shopfloorarea.$error.required">{{'SHOPFLOOR.INPUT_AREA' | translate}}</small>
                        <small class="text-danger" ng-show="form_shopfloor.shopfloorarea.$error">{{'SETTING.INVALID_FORMAT' | translate}}</small>
                    </div>
                </div>
            </div>
            <div class="form-group"><label class="col-sm-2 control-label">{{'SETTING.CONTACT' | translate}}</label>
                <div class="col-sm-10">
                    <ui-select ng-model="shopfloor.contact.id" name="shopfloorcontact" theme="bootstrap" required>
                        <ui-select-match allow-clear="false" placeholder="{{'COMMON.PLACEHOLDER' | translate}}">{{$select.selected.name}}</ui-select-match>
                        <ui-select-choices repeat="contact.id as contact in contacts | filter: $select.search">
                            <div ng-bind-html="contact.name | highlight: $select.search"></div>
                            <small>{{contact.email}},{{contact.phone}}</small>
                        </ui-select-choices>
                    </ui-select>
                    <div class="m-t-xs" ng-show="form_shopfloor.shopfloorcontact.$invalid && form_shopfloor.shopfloorcontact.$dirty">
                        <small class="text-danger" ng-show="form_shopfloor.shopfloorcontact.$error.required">{{'SETTING.SELECT_CONTACT' | translate}}</small>
                    </div>
                </div>
            </div>
            <div class="form-group"><label class="col-sm-2 control-label">{{'SETTING.IS_INPUT_COUNTED' | translate}}</label>
                <div class="col-sm-10">
                    <div class="checkbox checkbox-success">
                        <input id="chk_shopfloor_isinputcounted" type="checkbox" ng-model="shopfloor.is_input_counted" ng-checked="shopfloor.is_input_counted" >
                        <label for="chk_shopfloor_isinputcounted">{{'SETTING.IS_INPUT_COUNTED' | translate}}</label>
                    </div>

                </div>
            </div>
            <div class="form-group"><label class="col-sm-2 control-label">{{'SETTING.COSTCENTER' | translate}}</label>
                <div class="col-sm-10">
                    <ui-select ng-model="shopfloor.cost_center.id" theme="bootstrap" required>
                        <ui-select-match allow-clear="false" placeholder="{{'COMMON.PLACEHOLDER' | translate}}">{{$select.selected.name}}</ui-select-match>
                        <ui-select-choices repeat="costcenter.id as costcenter in costcenters | filter: $select.search">
                            <div ng-bind-html="costcenter.name | highlight: $select.search"></div>
                        </ui-select-choices>
                    </ui-select>
                </div>
            </div>
            <div class="form-group"><label class="col-sm-2 control-label">{{'SETTING.DESCRIPTION' | translate}} ({{'SETTING.OPTIONAL' | translate}})</label>
              <div class="col-sm-10">
                  <input ng-model="shopfloor.description" type="text" name="shopfloordescription" class="form-control">
              </div>
            </div>
            <div class="form-group" ng-show="shopfloor.qrcode"><label class="col-sm-2 control-label">{{'COMMON.QR_CODE' | translate}} </label>
             <div class="col-sm-10">
                  <div>
                       <qrcode data="{{shopfloor.qrcode}}" version="1" error-correction-level="L" size="100" color="#fff" background="#000" download></qrcode>
                  </div>
              </div>
            </div>
        </form>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-white" ng-click="cancel()">{{'SETTING.CANCEL' | translate}}</button>
        <button type="button" ng-disabled="form_shopfloor.$invalid" class="btn btn-primary" ng-click="ok()">{{'SETTING.SAVE' | translate}}</button>
    </div>
</div>
